home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2006 February / Gamestar_81_2006-02_dvd.iso / Red Shark / Common / SovietTruck.script < prev    next >
Text File  |  2001-10-11  |  2KB  |  84 lines

  1. //-------------------------------------------------------------------
  2. //
  3. //  This code is copyright 2001 by G5 Software.
  4. //  Any unauthorized usage, either in part or in whole of this code
  5. //  is strictly prohibited. Violators WILL be prosecuted to the
  6. //  maximum extent allowed by law.
  7. //
  8. //-------------------------------------------------------------------
  9.  
  10. class CSovietTruckMesh
  11. {
  12.   string MeshFile = "Models/S_Truck.mesh";
  13.   string SkinFile = "Models/S_Truck.skin";
  14.   string AnimFile = "Models/S_Truck.anim";
  15. }
  16.  
  17. class CSovietTruckStateControl extends CMobileGroundUnitStateControl
  18. {
  19.   void CSovietTruckStateControl()
  20.   {
  21.     CMobileGroundUnitStateControl(500.0);
  22.     m_DestroyPause = 7.5;
  23.     m_ExplosionId  = "EXPLID_SovietTruckExplosion";
  24.   }
  25. }
  26.  
  27. class CSovietTruckBehavior extends CBaseBehavior, CSovietTruckMoveParameters
  28. {
  29.   boolean  CanFire = false; // tell behavior that object cannot fire
  30.   boolean  HasRadar = true;
  31.  
  32.   float  MaxRadarDistance = 500; // m
  33.   float  MinRadarDistance = 10;   // m
  34.  
  35.   int    UpdateRadarPeriod        = 2000; // ms
  36.   int    UpdateRadarPeriodRandAdd = 5000; // ms
  37.  
  38.   boolean  FireFlying = false;
  39.   boolean  FireGround = true;
  40.  
  41.   void CSovietTruckBehavior()
  42.   {
  43.     CBaseBehavior();
  44.   }
  45. }
  46.  
  47. class CSovietTruckMoveParameters
  48. {
  49.   boolean  CanMove = true;
  50.  
  51.   float  MaxSpeed              = 14;   // m/s
  52.   float  MaxAngleSpeed         = 2;    // rad/s
  53.   float  MaxAccelleration      = 15;   // m/(s*s)
  54.   float  MaxAngleAccelleration = 10;   // rad/(s*s)
  55.  
  56.   float  MoveBank     = -.03; //#TMP: 
  57.   float  RotationBank = .006;   //#TMP:
  58. }
  59.  
  60. class CSovietTruck extends
  61.   CGroundUnit,
  62.   CArmedUnit,
  63.   CUnitWithSound,
  64.   CUnitWithCamera,
  65.   CUnitWithStateControl,
  66.   CUnitWithBehavior
  67. {
  68.   void CSovietTruck()
  69.   {
  70.     InitializeModelAsStatic("CSovietTruckMesh");
  71.     CUnitWithStateControl("CSovietTruckStateControl");
  72.     InitializeSound("CSovietTruckEngineSound");
  73.  
  74.     //#TODO create weapons
  75.  
  76.     InitializeVehicleBehavior("CSovietTruckBehavior");
  77.  
  78.     Core_AddClassificator("Russian");
  79.     Core_AddClassificator("Truck");      // for cockpit identification
  80.     Core_AddClassificator("GroundUnit"); // for behavior fire logic
  81.   }
  82. }
  83.  
  84.